#include "dowconstraint.h"
#include "logger.h"

/// \param dow Bitset of days of week allowed.  See documentation for the dow_
/// data member.
DOWConstraint::DOWConstraint(const dow& the_dow)
	: dow_(the_dow)
{
}

DOWConstraint::~DOWConstraint()
{
}

/// Tests a schedule object to see if it fulfills the days-of-week constraint.
/// \param schedule The schedule object against which the constraint is tested.
/// \return True if the schedule fulfills the constraint, false otherwise.
bool DOWConstraint::consider(const Schedule& schedule)
{
    Logger::instance()->warning("DOWConstraint::consider() was called, but isn't implemented yet.", 1);

    using namespace std;
    Schedule schedule_copy(schedule); // copy to non-const
    vector<CourseSection> sections(schedule_copy.getCourses());
    for( vector<CourseSection>::iterator i = sections.begin();
         i != sections.end(); ++i ) {
    }
	return false;				// TODO: implement check for day-of-week
}

std::string DOWConstraint::to_string()
{
    switch( dow_ ) {
    case Monday:
        return "Monday";
    case Tuesday:
        return "Tuesday";
    case Wednesday:
        return "Wednesday";
    case Thursday:
        return "Thursday";
    case Friday:
        return "Friday";
    case Saturday:
        return "Saturday";
    case Sunday:
        return "Sunday";
    default:
        Logger::instance()->error("Invalid day specified in DOWConstraint;  "
                                  "can not convert to string.", 1);
        return "";
    }
}
